<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    public static $registry = null;
    public function _initFrontController ()
    {
        $frontController = Zend_Controller_Front::getInstance();
        //$frontController->registerPlugin( new App_Controller_Plugin_ErrorControllerSelector());
        //$frontController->registerPlugin(new App_Controller_Plugin_Modularlayout());
        //$frontController->registerPlugin(new App_Controller_Plugin_CacheInit());
        //comentei pra por um plugin para exibir o controlador de erros
        //$frontController->throwExceptions(true);
        //ver isso aqui, nao deveria esta assim, mas a view nao pega...
        $frontController->returnResponse(false);
        $frontController->setControllerDirectory(
        array('default' => APPLICATION_PATH . '/controllers', 
        'zfarm' => APPLICATION_PATH . '/modules/zfarm/controllers'));
        $frontController->addModuleDirectory(APPLICATION_PATH . '/modules');
        $frontController->setParam('registry', $this->registry);
        return $frontController; // this is *VERY* important
    }
    public function _initHelpers ()
    {
        Zend_Controller_Action_HelperBroker::addPath(
        APPLICATION_PATH . '/helpers/', 'Zend_Controller_Action_Helper');
        Zend_Controller_Action_HelperBroker::addPath('helpers/', 
        'Zend_Controller_Action_Helper');
    }
    protected function _initAutoload ()
    {
        $autoloader = new Zend_Application_Module_Autoloader(
        array('basePath' => APPLICATION_PATH, 'namespace' => ''));
        return $autoloader;
    }
}

